(function (window, document) {
  var showTotast = function (content) {
    // 生成一个i标签
    var totast = document.createElement('i')
    // 添加类名
    totast.classList.add('totast')
    // 添加totast内容
    totast.innerText = content

    totast.addEventListener('animationiteration', function () {
      this.style.animationPlayState = 'paused'
      var _this = this
      setTimeout(function () {
        _this.style.animationPlayState = 'running'
      }, 2000)
    })

    totast.addEventListener('animationend', function () {
      this.parentNode.removeChild(this)

    })

    document.body.appendChild(totast)
  }
  window.totast = showTotast
}(window, document))